Public Class WebForm

  Private Sub DownloadPageButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DownloadPageButton.Click

    ResultTextBox.Text = String.Empty

    If DataTextBox.Text.Length > 0 Then
      ResultTextBox.Text = dotNetTips.Utility.Web.WebHelper.DownloadWebpage(DataTextBox.Text)
    End If

  End Sub

  Private Sub HTMLEncodeButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles HTMLEncodeButton.Click

    ResultTextBox.Text = String.Empty

    If DataTextBox.Text.Length > 0 Then
      ResultTextBox.Text = dotNetTips.Utility.Web.WebHelper.HtmlEncode(DataTextBox.Text)
    End If

  End Sub

  Private Sub HTMLDecodeButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles HTMLDecodeButton.Click
    ResultTextBox.Text = String.Empty

    If DataTextBox.Text.Length > 0 Then
      ResultTextBox.Text = dotNetTips.Utility.Web.WebHelper.HtmlDecode(DataTextBox.Text)
    End If

  End Sub

  Private Sub URLEncodeButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles URLEncodeButton.Click

    ResultTextBox.Text = String.Empty

    If DataTextBox.Text.Length > 0 Then
      ResultTextBox.Text = dotNetTips.Utility.Web.WebHelper.UrlEncode(DataTextBox.Text)
    End If


  End Sub

  Private Sub URLDecodeButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles URLDecodeButton.Click

    ResultTextBox.Text = String.Empty

    If DataTextBox.Text.Length > 0 Then
      ResultTextBox.Text = dotNetTips.Utility.Web.WebHelper.UrlDecode(DataTextBox.Text)
    End If


  End Sub

  Private Sub ResultTextBox_DoubleClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ResultTextBox.DoubleClick
    Me.DataTextBox.Text = Me.ResultTextBox.Text
  End Sub

  Private Sub XMLEncodeButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles XMLEncodeButton.Click

    ResultTextBox.Text = String.Empty

    If DataTextBox.Text.Length > 0 Then
      ResultTextBox.Text = dotNetTips.Utility.Web.WebHelper.XmlEncode(DataTextBox.Text)
    End If

  End Sub

 
End Class